package models.seller.ebay;

import javax.persistence.*;

import java.sql.*;
import java.sql.Blob;

import javax.sql.*;

import models.user.Customer;
import controllers.Application;

import java.math.*;
import java.util.*;
import java.util.Date;

import play.db.jpa.Model;
import play.cache.Cache;
import play.db.jpa.*;
import play.mvc.Scope;

/**
 * ebay 开发帐号表
 * 
 * @author yechao
 * @date 2013年11月2日
 */
@Entity
@Table(name = "ebay_developer_account")
public class EbayDeveloperAccount extends Model {
	/**
	 * 客户Id customer表的id . 一般是空,作为本公司通用开发帐号, 如果客户希望使用自己的开发帐号,亦支持
	 */
	@Column(name = "customer_id")
	public Long customer_id;

	/**
	 * 客户帐号
	 */
	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH }, optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id", insertable = false, updatable = false)
	public Customer customer;

	/**
	 * ebay开发服务配置 id, 多个开发帐号可以公用的配置
	 */
	@Column(name = "ebay_developer_serve_config_id")
	public Long ebayDeveloperServeConfigId;

	/**
	 * ebay 开发服务配置
	 */
	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH }, optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name = "ebay_developer_serve_config_id", insertable = false, updatable = false)
	public EbayDeveloperServeConfig ebayDeveloperServeConfig;

	/**
	 * 开发者编号
	 */
	@Column(name = "developer_id", length = 150)
	public String developerId;

	/**
	 * 程序编号
	 */
	@Column(name = "application_id", length = 150)
	public String applicationId;

	/**
	 * 开发者凭证
	 */
	@Column(name = "certificate_id", length = 150)
	public String certificateId;

	/**
	 * run name 对应 developer_id application_id certificate_id 一组信息
	 */
	@Column(name = "ru_name", length = 150)
	public String ruName;

	/**
	 * 开发帐号状态 意义见常量类
	 */
	@Column(name = "status", length = 2)
	public Integer status;
	/**
	 * 创建时间
	 */
	@Column(name = "created_time")
	public Date createdTime;

	/**
	 * 帐号备注
	 */
	@Column(name = "remark", length = 150)
	public String remark;
}
